<ion-view view-title="商品编辑" id="goods-edit" hide-nav-bar="true">
  <ion-header-bar align-title="center" class="bar-calm">
    <div class="buttons">
      <button class="button head-button button-clear center-btn" ng-click="goBack()">
        <img src="img/order-commit/backIcon.png">
      </button>
    </div>
    <h1 class="title">编辑商品</h1>
    <div class="buttons">
      <button class="button head-button button-clear center-btn" ng-click="goSave()">
        保存
      </button>
    </div>
  </ion-header-bar>
  <ion-content>
    <img-picker items="goods.mainimg" isupk="goods"></img-picker>
    <div class="list">
      <label class="item item-input">
        <span class="label">商品标题</span>
        <input type="text"
               ng-model="goods.title"
               ng-required="true"
               placeholder="商品标题"
               ng-disabled= "goods.isupk == '1' ">
      </label>
      <label class="item item-input" >
        <span class="label">商品编号</span>
        <input type="text"
               ng-model="goods.productno"
               ng-required="true"
               placeholder="商品编号"
               ng-disabled="goods.isupk =='1' ">
      </label>
      <label class="item item-input" >
        <span class="label">商品库存</span>
        <input type="text"
               ng-model="goods.productsku"
               ng-required="true"
               placeholder="商品库存"
               ng-disabled="goods.isupk =='1' ">
      </label>

      <label class="item item-input" >
        <span class="label">销售价</span>
        <input type="text"
               ng-model="goods.saleprice"
               ng-required="true"
               placeholder="销售价">
      </label>
        <label class="item item-input">
            <span class="label">计量单位</span>
            <input type="text"
                   ng-model="goods.unitage"
                   ng-required="true"
                   placeholder="  计量单位"
                   ng-disabled="goods.isupk =='1' "
                   style="margin-left:15px">
        </label>
        <label class="item item-input">
            <span class="label">品牌</span>
            <input type="text"
                   ng-model="goods.brand"
                   ng-required="true"
                   placeholder="  商品品牌"
                   ng-disabled="goods.isupk =='1' "
                   style="margin-left:15px">
        </label>
        <label class="item item-input">
            <span class="label">原产国</span>
            <input type="text"
                   ng-model="goods.countries"
                   ng-required="true"
                   placeholder="  原产国"
                   ng-disabled="goods.isupk =='1' "
                   style="margin-left:15px">
        </label>
        <label class="item item-input">
            <span class="label">规格型号</span>
            <input type="text"
                   ng-model="goods.model"
                   ng-required="true"
                   placeholder="  规格型号"
                   ng-disabled="goods.isupk =='1' "
                   style="margin-left:15px">
        </label>
        <label class="item item-input">
            <span class="label">规格参数</span>
            <input type="text"
                   ng-model="goods.conditions"
                   ng-required="true"
                   placeholder="  规格参数"
                   ng-disabled="goods.isupk =='1' "
                   style="margin-left:15px">
        </label>
        <label class="item item-input">
            <span class="label">售后服务</span>
            <input type="text"
                   ng-model="goods.service"
                   ng-required="true"
                   placeholder="  售后服务"
                   ng-disabled="goods.isupk =='1' "
                   style="margin-left:15px">
        </label>
        <label class="item item-input">
            <span class="label">运费</span>
            <input type="text"
                   ng-model="goods.sendmoney"
                   ng-required="true"
                   placeholder="  运费"
                   ng-disabled="goods.isupk =='1' "
                   style="margin-left:15px">
        </label>
        <label class="item item-input">
            <span class="label">最新上架</span>
            <div class="divIs" on-tap="changeNewOn()">
                <i ng-if="goods.isnew != 1" class="ion-ios-circle-outline"></i>
                <i ng-if="goods.isnew == 1" class="ion-ios-checkmark-outline checked"></i>
                <span>是</span>
            </div>
            <div class="divNo" on-tap="changeNewOff()">
                <i ng-if="goods.isnew == 1" class="ion-ios-circle-outline"></i>
                <i ng-if="goods.isnew != 1" class="ion-ios-checkmark-outline checked"></i>
                <span>否</span>
            </div>
        </label>
        <label class="item item-input">
            <span class="label">热门促销</span>
            <div class="divIs" on-tap="changeHotOn()">
                <i ng-if="goods.ishot != 1" class="ion-ios-circle-outline"></i>
                <i ng-if="goods.ishot == 1" class="ion-ios-checkmark-outline checked"></i>
                <span>是</span>
            </div>
            <div class="divNo" on-tap="changeHotOff()">
                <i ng-if="goods.ishot == 1" class="ion-ios-circle-outline"></i>
                <i ng-if="goods.ishot != 1" class="ion-ios-checkmark-outline checked"></i>
                <span>否</span>
            </div>
        </label>
        <label class="item item-input">
            <span class="label">店长推荐</span>
            <div class="divIs" on-tap="changeTopOn()">
                <i ng-if="goods.istop != 1" class="ion-ios-circle-outline"></i>
                <i ng-if="goods.istop == 1" class="ion-ios-checkmark-outline checked"></i>
                <span>是</span>
            </div>
            <div class="divNo" on-tap="changeTopOff()">
                <i ng-if="goods.istop == 1" class="ion-ios-circle-outline"></i>
                <i ng-if="goods.istop != 1" class="ion-ios-checkmark-outline checked"></i>
                <span>否</span>
            </div>
        </label>
        <div class="area-div">
            <span class="text">发货地点</span>
            <div class="province-div">
                <select ng-click="goods.isupk =='1'" ng-disabled="goods.isupk =='1'" ng-model="goods.province" ng-options="province.provinceid as province.provincename for province in provinceData" ng-change="getProvince()">
                    <option value="">请选择省</option>
                </select>
            </div>
            <div class="city-div">
                <select ng-click="goods.isupk =='1'" ng-disabled="goods.isupk =='1'" ng-model="goods.city" ng-options="city.cityid as city.cityname for city in currentCity" ng-change="getCity()">
                    <option value="">请选择市</option>
                </select>
            </div>
        </div>
        <div class="area-div">
            <span class="text">商品分类</span>
            <div class="province-div">
                <select ng-click="goods.isupk =='1'" ng-disabled="goods.isupk =='1'" ng-model="goods.firstsort" ng-options="firstSort.firstsortid as firstSort.firstsortname for firstSort in Allsort" ng-change="getFirst()">
                    <option value="">请选择</option>
                </select>
            </div>
            <div class="city-div">
                <select ng-click="goods.isupk =='1'" ng-disabled="goods.isupk =='1'" ng-model="goods.secondsort" ng-options="secondsort.secondsortid as secondsort.secondsortname for secondsort in secondSort" ng-change="getSecond()">
                    <option value="">请选择</option>
                </select>
            </div>
            <div class="city-div">
                <select ng-click="goods.isupk =='1'" ng-disabled="goods.isupk =='1'" ng-model="goods.thirdsort" ng-options="thirdsort.thirdsortid as thirdsort.thirdsortname for thirdsort in thirdSort" ng-change="getThird()">
                    <option value="">请选择</option>
                </select>
            </div>
        </div>
      <label class="item item-input" style="border: 0">
        <span class="label">图片描述:</span>
      </label>
      <img-picker items="goods.txtimg" isupk="goods"></img-picker>
    </div>
    <div class="bottom-blank"></div>
  </ion-content>

</ion-view>
